<template>
	<view>
		<view class="topPlace"></view>
		<view class="pl30 pr30 pt100">
			<u-tabs :list="list" :is-scroll="false" :current="current" @change="change" class="box" bg-color='none'>
			</u-tabs>
			<!-- 动态组件 -->
				<component :is="showLogin"></component>
		</view>
	</view>
</template>

<script>
	import captchaLogin from '@/components/captchaLogin.vue'
	import passwdLogin from '@/components/passwdLogin.vue'
	export default {
		components: {
			captchaLogin,
			passwdLogin
		},
		data() {
			return {
				//tab栏
				list: [{
					name: '密码登录'
				}, {
					name: '手机号登录'
				}],
				current: 0,
				showLogin: 'passwdLogin',
			};
		},
		methods: {
			change(index) {
				this.current = index;
				this.current == 0 ? this.showLogin = 'passwdLogin' : this.showLogin = 'captchaLogin'
			}
		}
	}
</script>

<style lang="scss">
	page {
		background: url(../../static/img/index/loginbg.png) no-repeat;
		background-size: 100% auto;
	}
</style>
